import request from '@/utils/request'

export default {
    //添加课程信息
    addCourseInfo(courseInfo){
        return request({
            url: '/eduservice/course/addCourse',
            method: 'post',
            data:courseInfo
        })
    },
    //查询所有讲师
    getTeacherList(){
        return request({
            url: '/eduservice/edu-teacher/findAll',
            method: 'get'
        })
    },
    //根据id查询课程信息
    getCourseInfoById(courseId){
        return request({
            url: '/eduservice/course/getCourseInfo/'+courseId,
            method: 'get'
        })
    },
    //修改课程信息
    updateCourseInfo(courseInfoVo){
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data:courseInfoVo
        })
    },
    //根据课程id查询课程确认信息
    getPublishCourseInfo(courseId){
        return request({
            url: '/eduservice/course/getPublishCourseInfo/'+courseId,
            method: 'get'
        })
    },
    //课程发布
    toPublishCourse(courseId){
        return request({
            url: '/eduservice/course/publishCourse/'+courseId,
            method: 'post'
        })
    },
    //课程列表
    getCourseList(current,limit,courseQuery){
        return request({
            url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
            method: 'post',
            data:courseQuery
        })
    },
    //删除课程
    deleteCourseById(id){
        return request({
            url: `/eduservice/course/${id}`,
            method: 'delete'
        })
    }
}